import request from '@/utils/request.js'

export default {
	regUser(user) {
		return request({
			url: `/app/user/api/register`,
			method: 'POST',
			data: user
		})
	},
	loginUser(user) {
		return request({
			url: `/app/user/api/login`,
			method: 'POST',
			data: user
		})
	},
	restPassword(pwForm) {
		return request({
			url: `/app/user/api/resetPwd`,
			method: 'POST',
			data: pwForm
		})
	},
	updateUserInfo(userInfo) {
		return request({
			url: `/app/user/api/edit`,
			method: 'POST',
			data: userInfo
		})
	},
	getContactsList(sex, classesId) {
		return request({
			url: `/app/user/api/list`,
			data: {
				sex: sex,
				classesId: classesId
			}
		})
	},
	getUserInfoByUserId(userId) {
		return request({
			url: `/app/user/api/getById`,
			data: {
				userId: userId
			}
		})
	},
	getUserInfoByUserName(userName) {
		return request({
			url: `/app/user/api/getInfoByUserName`,
			data: {
				userName: userName
			}
		})
	},
	updateUserAvatar(avatarVo){
		return request({
				url: `/app/user/api/updateAvatar`,
				method: 'POST',
				data: avatarVo
				
			})
	}
}